package com.victor.utils;

import java.util.Map;

public class LoginUtil {

	public static Map<String, String> getWechartInfo(String openid, String access_token, String lang) {
		String url = "https://api.weixin.qq.com/cgi-bin/user/info";
		String param = "?access_token=" + access_token + "&openid=" + openid + "&lang=" + lang;
		String sendGet = HttpRequestUtils.sendGet(url, param);
		Map jsonToMap = JsonUtil.jsonToMap(sendGet);
		return jsonToMap;
	}

	public static Map<String, String> getQQInfo(String openid, String openkey, String appid, String sig, String pf) {
		String url = "http://openapi.tencentyun.com/v3/user/get_info?";
		String param = "openid=" + openid + "&openkey" + openkey + "&appid=" + appid + "sig=" + sig + "pf=" + pf;
		String sendGet = HttpRequestUtils.sendGet(url, param);
		Map jsonToMap = JsonUtil.jsonToMap(sendGet);
		return jsonToMap;
	}
}
